home *** CD-ROM | disk | FTP | other *** search
/ One Click 11 / OneClick11.iso / Bancos de Dados / Conversao / Mysql2Excel / Setup.exe / Mysql2Excel.exe / pywin / mfc / object.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2003-06-23  |  2.1 KB  |  57 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.2)
  3.  
  4. import sys
  5. import win32ui
  6.  
  7. class Object:
  8.     
  9.     def __init__(self, initObj = None):
  10.         self.__dict__['_obj_'] = initObj
  11.         if initObj is not None:
  12.             initObj.AttachObject(self)
  13.         
  14.  
  15.     
  16.     def __del__(self):
  17.         self.close()
  18.  
  19.     
  20.     def __getattr__(self, attr):
  21.         if attr != '__dict__':
  22.             
  23.             try:
  24.                 o = self.__dict__['_obj_']
  25.                 if o is not None:
  26.                     return getattr(o, attr)
  27.                 
  28.                 if attr[0] != '_' and attr[-1] != '_':
  29.                     raise win32ui.error, 'The MFC object has died.'
  30.             except KeyError:
  31.                 pass
  32.  
  33.         
  34.         raise AttributeError, attr
  35.  
  36.     
  37.     def OnAttachedObjectDeath(self):
  38.         self._obj_ = None
  39.  
  40.     
  41.     def close(self):
  42.         if self.__dict__.has_key('_obj_'):
  43.             if self._obj_ is not None:
  44.                 self._obj_.AttachObject(None)
  45.                 self._obj_ = None
  46.             
  47.         
  48.  
  49.  
  50.  
  51. class CmdTarget(Object):
  52.     
  53.     def __init__(self, initObj):
  54.         Object.__init__(self, initObj)
  55.  
  56.  
  57.